<template>
<div>
     <div class="wrap">
        <div class="header-wrap">
            <div class="header">
              <a class="home" href="#/"></a>
              <a class="logo" >订单</a>
            </div>
          </div>
          <header id="zmt_head" class="zmt_head">
            <el-input
    placeholder="请输入订单号"
    prefix-icon="el-icon-search"
    v-model="input1">
  </el-input>
          </header>
<div class="gold-picker" style="margin-top:10px">
<div class="picker-game">
<div><div class="am-list-item am-list-item-middle"><div class="am-list-line"><div class="am-list-content" >
     <el-select v-model="value" placeholder="请选择"  style="width:120px" >
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value="item.value" @click.native="select1(item.value)">
    </el-option>
  </el-select>

    </div></div></div></div>
</div>
</div>
<div class="am-list-body" v-for="item in list"><div class="list-view-section-body"><div class="row-row my--activity"><span class="row-operation"><a class="a" >编辑</a><span class="span" @click="deletei(item)">删除</span></span><div><div class="row-title"><div>{{item.title1}}</div></div><div class="row-extra"><div class="row-text">类别： {{item.orderType}}/{{item.classfiy1}} <br></div><div class="row-text">时限： <span class="span2">{{item.time1}}小时</span><span class="row-price">￥ {{item.money1}}</span></div></div></div></div><div class="am-whitespace am-whitespace-md"></div></div></div>
     </div>
     <div class="pub-logo" @click="fadan"><img src="http://m.1dailian.com/static/pub.999c9eb9.png" alt="发单" class="img"></div>
<orderfooter></orderfooter>
    </div>
</template>

<script >
import { orderfooter } from '../index'
import axios from 'axios'
 export default {
    data() {
      return {
        list:[{},{}],
        order:{
            money1:'',
            title1:'',
            time1:'',
            orderType:'',
            classfiy1:''
        },
         options: [{
          value: '我接手的',
          label: '我接手的'
        }, {
          value: '我发布的',
          label: '我发布的'
        }, ],
        value: '全部',
        input1:'',
        drawer: false,
        direction: 'btt',
      };
    },
     components: {
        orderfooter,
     },
     created(){
        this.select1()
     },
    methods: {
        deletei(i){
               let url='http://localhost:8098/order/deleteOrder'

               axios.post(url,i,{
         headers: {
           'content-type': 'application/json',
           "token":localStorage.getItem("token")  //token换成从缓存获取
        },
    }).then(resp=>{
            let result=resp.data
            if(result.code===200){
                this.select1()
                 this.$message({
            showClose: true,
          message: result.errorMessage,
          type: 'success'
        });
            }else{
                 this.$message({
            showClose: true,
          message: result.errorMessage,
          type: 'error'
        });
            }
        })
        },
        select1(i){
            if(i==undefined){
                this.value='全部'
            }else{
                this.value=i
            }
            let url='http://localhost:8098/order/selectOrder'
            let param={
                index:this.value,
            }
            axios.post(url,param,{
         headers: {
           'content-type': 'application/json',
           "token":localStorage.getItem("token")  //token换成从缓存获取
        }
    }).then(resp=>{
        let result=resp.data;
        if(result.code===200){
            console.log(result.data)
            this.list=result.data;
        }
    })
        },
        fadan(){
            this.$router.push("/orderfa")
        }
    //   handleClose(done) {
    //     this.$confirm('确认关闭？')
    //       .then(_ => {
    //         done();
    //       })
    //       .catch(_ => {});
    //   }
    }
  };
</script>
<style scoped>
.row-price {
    display: inline-block;
    width: auto;
    float: right;
    font-size: 14px;
    font-weight: 700;
    color: #1482ff;
}
.span2{
    display: inline-block;
    width: auto;
    color: #00cc86;
}
.row-text {
    display: inline-block;
    line-height: 26px;
    color: #727888;
    width: 100%;
    font-size: 12px;
}
 .row-extra {
    display: -webkit-box;
    position: relative;
    padding: .25rem 0;
    margin-top: 8px;
}
.span{
        color: #ff5067;
    margin-left: 33px;
    padding: 2px 0;
}
.a{
    color: #00cc86;
        touch-action: manipulation;
            text-decoration: none;
    background-color: transparent;
    outline: none;
    cursor: pointer;
    transition: color .3s;
}
 .row-title {
        width: 70%!important;
            white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
        height: 2.5rem;
        position: relative;
    font-size: 14px;
    border-bottom: 1px dashed #e8e8e8;
    line-height: 20px;
    color: #2d2f3b;
    display: flex;
}
.row-operation {
    position: absolute;
    right: 0;
    top: 0;
    z-index: 999;
    font-size: 11px;
    padding: 15px 12px;
    color: #727888;
}
.row-row {
        background-color: #fff;
            position: relative;
    padding: 12px 16px!important;
    box-shadow: 0 4px 20px 0 rgba(175,177,187,.1);
}
.am-list-body {
    position: relative;
    background-color: #f4f5f8;
    padding: 10px 16px;
    border-top: none;
    border-bottom: none;
}
.am-list-content {
    font-size: 11px!important;
        flex: 1 1;
    line-height: 1.5;
    text-align: left;
    width: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-top: 7px;
    padding-bottom: 7px;
    display: contents;
    color: #000000!important;
}
.am-list-line {
        position: relative;
    display: flex;
    flex: 1 1;
    align-self: stretch;
    padding-right: 15px;
    overflow: hidden;
    align-items: center;
    border-bottom: none!important;
    justify-content: center;
}
.am-list-item {
        position: relative;
    display: flex;
    min-height: 44px;
    vertical-align: middle;
    overflow: hidden;
    transition: background-color .2s;
    align-items: center;
        background-color: #ffffff;
    padding-left: 15px;
}
.picker-game {
    flex: 0.2 1;
}
 .gold-picker {
    background-color: #ffffff;
    background: #ffffff;
    display: flex;
    padding: 0;
}
.pub-logo {

    width: 77px;
    position: fixed;
    right: 0;
    bottom: 60px;
    z-index: 1000;
    /* width: 100%;
    height: 100%; */

}
article>p {
    padding: 0;
    margin: 0;
        display: block;
    text-align: justify;
    font-size: 18px;
    margin-bottom: 17px;
    white-space: normal;
    line-height: 30px;
}
article {
    padding: 20px 15px 0;
    font-size: 17px;
    line-height: 1.67em;
    word-break: break-all;
    word-wrap: break-word;
    position: relative;
}
.btn{
    color: crimson;
}
.follow_btn {
    float: right;
    position: relative;
    margin-top: -10px;
    width: 53px;
    line-height: 28px;
    height: 28px;
    border-radius: 1.5px;
    background: #fff2f2;
    font-size: 12px;
    display: inline-block;
    text-align: center;
}
.zmt_time {
    font-size: 12px;
    line-height: 0px;
    height: 13px;
    vertical-align: middle;
    color: #999;
}
.zmt_name {
    display: inline-block;
    font-size: 14px;
    line-height: 0px;
    color: inherit;
    margin: 2px 0 6px;
}
.zmt-info {
    padding-left: 39px;
}
.zmt_headimg:after {
    position: absolute;
    content: '';
    left: 0;
    top: 0;
    width: 198%;
    height: 198%;
    border: 1px solid #f0f0f0;
    border-radius: 50%;
    -webkit-transform: scale(.5);
    -webkit-transform-origin: 0 0;
}
.img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
}
.verify-img__head {
    border-radius: 50%;
    overflow: hidden;
}
.verify-img__poster {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border: 3px solid #fff;
    border-radius: 50%;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 2;
}
.wrap{
       max-width: 720px;
    margin: 0 auto;
    height: auto!important;
    width: 100%;
    height: 100%;
    background: #fff;
    font-family: STHeiti,'Microsoft YaHei',Helvetica,Arial,sans-serif;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
        overflow: hidden;
}

.zmt_headimg {
    width: 35px;
    height: 35px;
    float: left;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
    background-color: #eee;
    position: relative;
}
.zmt_head {
        padding: 0 15px;

}
.home {
    position: absolute;
    top: 13.5px;
    left: 15px;
    background: url(https://p5.ssl.qhimg.com/t015a542a760381d5a8.png) 50% no-repeat;
    background-size: cover;
    width: 16px;
    height: 17px;
}
.header-wrap {
    height: 44px;
    position: relative;
}
.header {
    height: 40px;
    line-height: 40px;
    padding: 2px 0;
    background: #fff;
    text-align: center;
    position: fixed;
    top: 0;
    width: 100%;
    left: 0;
    right: 0;
    z-index: 10;
}
</style>
